#include "callbackpage.h"

#include <QVBoxLayout>
#include <QPushButton>
#include <QDebug>
#include <QIcon>
#include <QTimer>
#include <QFile>
#include <QComboBox>
#include <QLineEdit>

CallbackPage::CallbackPage(QWidget *parent)
    : QWidget(parent)
{
    QVBoxLayout *mainLayout = new QVBoxLayout(this);
    setLayout(mainLayout);

    int (CallbackPage::*pf)(int, int) = &CallbackPage::getSub;
    execGetSumCallbackFun(pf);

    execGetSumCallbackFun(&CallbackPage::getSum);

}

CallbackPage::~CallbackPage()
{
}

int CallbackPage::getSub(int a, int b)
{
    return a - b;
}

int CallbackPage::getSum(int a, int b)
{
    return a + b;
}

void CallbackPage::execGetSumCallbackFun(int (CallbackPage::*fp)(int, int))
{
    int sum = (this->*fp)(6, 1);

    qInfo() << Q_FUNC_INFO << sum;
}
